<?xml version="1.0" encoding="utf-8" ?>
<Recipe xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
Name="SiteColumn"
xmlns="http://schemas.microsoft.com/pag/gax-core"
Bound="false">
  <DocumentationLinks>
    <Link Caption="MSDN: Field Element Schema" Url="http://msdn.microsoft.com/en-us/library/ms437580.aspx" Kind="Documentation" />
  </DocumentationLinks>
  <xi:include href="../../../TypeAlias.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
  <Caption>Site Column</Caption>
  <Description>Adds a site column to the current selected feature</Description>
  <HostData>
    <Icon File="Help/Icons/icon_ListAndDoc.ico" />
    <CommandBar Menu="SPSFProjectListAndDoc"/>
    <CommandBar Menu="SPSFFolderListAndDoc"/>
    <spsf:MetaData
      Visible="true"
      BindingType="ElementManifestReference"
      BindingTypeTemplate="ElementManifestReferenceTemplate"
      TestType="BaseSiteFeatureRecipeRunner"
      Enabled="true"
      CreateVSTemplate="true"
      FeatureScopes="Web;Site"
      Category="ListAndDoc" xmlns:spsf="http://www.spalmblogger.de">
      <spsf:Authors>
        <spsf:Author>Torsten Mandelkow</spsf:Author>
      </spsf:Authors>
      <spsf:VersionHistory>
        <spsf:VersionHistoryEntry>1.0 Initial Recipe</spsf:VersionHistoryEntry>
      </spsf:VersionHistory>
      <spsf:WebPageContent>
        <![CDATA[]]>
      </spsf:WebPageContent>
    </spsf:MetaData>
  </HostData>
  <Arguments>

    <Argument Name="AllowedScopes" Type="System.String">
      <ValueProvider Type="Evaluator" Expression="Site" />
    </Argument>

    <xi:include href="../../BaseArguments.include" parse="xml" xpointer="xmlns(p=http://schemas.microsoft.com/pag/gax-core) xpointer(/p:Arguments/*)" xmlns:xi="http://www.w3.org/2001/XInclude" />

    <xi:include href="../BaseFeatureArguments.include" parse="xml" xpointer="xmlns(p=http://schemas.microsoft.com/pag/gax-core) xpointer(/p:Arguments/*)" xmlns:xi="http://www.w3.org/2001/XInclude" />

    <Argument Name="ElementsCategory">
      <ValueProvider Type="Evaluator" Expression="Fields" />
    </Argument>

    <Argument Name="ResourceKeyPrefix" Required="true">
      <!-- provides the unique key with removed special chars -->
      <ValueProvider Stage="OnBeforeActions" RecipeArgument="SiteColumnName" Type="ConvertedStringProvider" />
    </Argument>

    <Argument Name="SiteColumnID">
      <ValueProvider Type="SPALM.SharePointSoftwareFactory.Library.ValueProviders.GuidValueProvider, SPALM.SharePointSoftwareFactory.Library" />
    </Argument>
    <Argument Name="SiteColumnName">
      <Converter Type="NamespaceStringConverter" />
      <ValueProvider Type="VisualStudioCreateItemName" MakeSafe="true" DefaultValue="SiteColumn1" />
    </Argument>
    <Argument Name="SiteColumnDisplayName">
      <ValueProvider Type="Evaluator" Expression="$(SiteColumnName) Name" />
    </Argument>
    <Argument Name="SiteColumnDescription">
      <ValueProvider Type="Evaluator" Expression="$(SiteColumnName) Description" />
    </Argument>
    <Argument Name="SiteColumnGroup">
      <ValueProvider Type="Evaluator" Expression="$(AppName) Columns" />
    </Argument>

    <Argument Name="SiteColumnSchema" />

  </Arguments>
  <GatheringServiceData>
    <Wizard xmlns="http://schemas.microsoft.com/pag/gax-wizards" SchemaVersion="1.0">
      <Pages>
        <Page Type="SPALM.SharePointSoftwareFactory.Library.CustomWizardPages.FeatureSelectionPage, SPALM.SharePointSoftwareFactory.Library" />
        <Page Height="350">
          <Title>Site Column Type</Title>
          <Fields>
            <Field ValueName="SiteColumnID" Label="ID">
              <Help>Required Text. Specifies the GUID of the field.</Help>
            </Field>
            <Field ValueName="SiteColumnName" Label="Name">
              <Help>Required Text. The name of a field. This is the internal name of a field and is guaranteed never to change for the lifetime of the field definition. It must be unique with respect to the set of fields in a list. The name is autogenerated based on the user-defined name for a field.</Help>
            </Field>
            <Field ValueName="SiteColumnDisplayName" Label="Display Name">
              <Help>Optional Text. The displayed name for a field. There is no restriction on text size or use of spaces. The display name can be edited by the user and can change after initial field creation. This name is used as a column heading when the field is displayed in a table view and as a form label when the field is displayed in a form. The FieldName tag returns the display name if given; otherwise, it defaults to the Name attribute.</Help>
            </Field>
            <Field ValueName="SiteColumnDescription" Label="Description">
              <Help>Optional Text. Provides the description that is shown in the edit form for a list if a field description is specified. By default, fields in Microsoft Windows SharePoint Services do not have descriptions.</Help>
            </Field>
            <Field ValueName="SiteColumnGroup" Label="Group" >
              <Help>Optional Text. Specifies the column group to which the field belongs.</Help>
              <Editor Type="SPALM.SharePointSoftwareFactory.Library.Editors.SharePointConfigurationSiteColumnGroupEditor, SPALM.SharePointSoftwareFactory.Library" />
            </Field>
          </Fields>
        </Page>
        <Page Type="SPALM.SharePointSoftwareFactory.Library.CustomWizardPages.SiteColumnPage, SPALM.SharePointSoftwareFactory.Library" />
      </Pages>
    </Wizard>
  </GatheringServiceData>
  <Actions CoordinatorServiceType="ConditionalCoordinator">

    <xi:include href="../../BaseStartingActions.include" parse="xml" xpointer="xmlns(p=http://schemas.microsoft.com/pag/gax-core) xpointer(/p:Actions/*)" xmlns:xi="http://www.w3.org/2001/XInclude" />

    <xi:include href="../BaseFeatureActions.include" parse="xml" xpointer="xmlns(p=http://schemas.microsoft.com/pag/gax-core) xpointer(/p:Actions/*)" xmlns:xi="http://www.w3.org/2001/XInclude" />

    <!-- elements.xml-->
    <Action
      Name="CreateElementsXml"
      Type="AddElementsDefinitionAction"
      ParentFeatureName="$(ParentFeatureName)"
      ElementsName="$(SiteColumnName)"
      ElementsCategory="$(ElementsCategory)"
      TemplateFileName="Text\SiteColumn\elements.xml.t4"
      SPDataTemplate="Text\SiteColumn\SharePointProjectItem.spdata.t4"
      Open="true">
      <Output Name="CreatedElementFolder" />
      <Output Name="CreatedElementFile" />
    </Action>

    <!-- Resources -->
    <Action
      Condition="$(AutoCreateResxFiles)"
      Name="AddResources"
      Type="AddTemlateToResourcesFileAction"
      TemplateFileName="Text\SiteColumn\Resources.resx.t4"
      FeatureResources="True">
      <Input Name="FeatureName" RecipeArgument="ParentFeatureName" />
    </Action>

    <xi:include href="../../BaseFinalActions.include" parse="xml" xpointer="xmlns(p=http://schemas.microsoft.com/pag/gax-core) xpointer(/p:Actions/*)" xmlns:xi="http://www.w3.org/2001/XInclude" />

  </Actions>
</Recipe>